import os,sys
from PIL import Image

list = ("2011_09_26_Mon/20110926_", "2011_09_27_Tue/20110927_", "2011_09_28_Wed/20110928_", "2011_09_29_Thu/20110929_", "2011_09_30_Fri/20110930_", "2011_10_01_Sat/20111001_")

if not os.path.exists("composite"):
  os.mkdir("composite")

for h in range(0,24):
  for m in range(0,60):
    # Compose image for this hour
    composite = Image.new("RGBA", (1920, 886))

    day1 = Image.open("%s%02d%02d.jpg" % (list[0], h, m))
    day2 = Image.open("%s%02d%02d.jpg" % (list[1], h, m))
    day3 = Image.open("%s%02d%02d.jpg" % (list[2], h, m))
    day4 = Image.open("%s%02d%02d.jpg" % (list[3], h, m))
    day5 = Image.open("%s%02d%02d.jpg" % (list[4], h, m))
    day6 = Image.open("%s%02d%02d.jpg" % (list[5], h, m))

    composite.paste(day1, (0   ,0  ))
    composite.paste(day2, (640 ,0  ))
    composite.paste(day3, (1280,0  ))
    composite.paste(day4, (0   ,443))
    composite.paste(day5, (640 ,443))
    composite.paste(day6, (1280,443))

    composite.thumbnail((1280, 800), Image.ANTIALIAS)

    composite.save("composite/%02d%02d.jpg" % (h,m))

      

